<template>
	<view class="iconfont sex" :class="[sex === 1 ? 'icon-nan' : 'icon-nv']">
		{{getAge}}
	</view>
</template>

<script>
	import {getAgeByBirthday} from 'common/tools/time.js'
	export default {
		props: {
			sex: {
				type: Number
			},
			birthday: {
				type: String
			}
		},
		computed:{
			getAge(){
				return getAgeByBirthday(this.birthday)
			}
		}
	}
</script>

<style lang="scss" scoped>
	.sex {
		border: 1upx solid #FFFFFF;
		background-color: #007AFF;
		color: #FFFFFF;
		font-size: 20upx;
		padding: 0 8upx;
		margin-left: 10upx;
		border-radius: 8upx;
		line-height: 34upx;

		&.icon-nv {
			background-color: #FF698D !important;
		}
	}
</style>
